<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

// Route::get('/vue','VueController@index');
// Route::get('/import','VueController@database');
// Route::get('/area','VueController@area');

// 后台路由
Route::group(['prefix'=>'console','namespace' => 'Admin'],function(){
    // 后台管理不用其它，只用登陆，退出
    // Route::auth();
    Route::get('login', 'PublicController@getLogin');
    Route::post('login', 'PublicController@postLogin');
    // 退出登陆
    Route::get('logout', 'PublicController@getLogout');
});

Route::group(['prefix'=>'console','middleware' => ['rbac'],'namespace' => 'Admin'],function(){
    // 分销配置
    Route::get('distributionconfig/index', 'Good\DistributionConfigController@getIndex');
    Route::post('distributionconfig/index', 'Good\DistributionConfigController@postIndex');
    // 签到配置
    Route::get('sign/config', 'User\SignController@getConfig');
    Route::post('sign/config', 'User\SignController@postConfig');
    // 选择商品
    Route::get('good/select/{type?}', 'Good\GoodController@getSelect');
    // 抢购管理
    Route::get('timetobuy/index', 'Good\TimetobuyController@getIndex');
    Route::get('timetobuy/add', 'Good\TimetobuyController@getAdd');
    Route::post('timetobuy/add', 'Good\TimetobuyController@postAdd');
    Route::get('timetobuy/edit/{id}', 'Good\TimetobuyController@getEdit');
    Route::post('timetobuy/edit/{id}', 'Good\TimetobuyController@postEdit');
    Route::get('timetobuy/del/{id}', 'Good\TimetobuyController@getDel');
    Route::post('timetobuy/sort', 'Good\TimetobuyController@postSort');
    Route::post('timetobuy/alldel', 'Good\TimetobuyController@postAlldel');
    // 广告位
    Route::get('adpos/index', 'Common\AdposController@getIndex');
    Route::get('adpos/add', 'Common\AdposController@getAdd');
    Route::post('adpos/add', 'Common\AdposController@postAdd');
    Route::get('adpos/edit/{id}', 'Common\AdposController@getEdit');
    Route::post('adpos/edit/{id}', 'Common\AdposController@postEdit');
    Route::get('adpos/del/{id}', 'Common\AdposController@getDel');
    // 社区
    Route::get('community/index', 'Common\CommunityController@getIndex');
    Route::get('community/add', 'Common\CommunityController@getAdd');
    Route::post('community/add', 'Common\CommunityController@postAdd');
    Route::get('community/edit/{id}', 'Common\CommunityController@getEdit');
    Route::post('community/edit/{id}', 'Common\CommunityController@postEdit');
    Route::get('community/del/{id}', 'Common\CommunityController@getDel');
    // 省市区域
    Route::get('area/index/{pid?}', 'Common\AreaController@getIndex');
    Route::get('area/add/{pid}', 'Common\AreaController@getAdd');
    Route::post('area/add/{pid}', 'Common\AreaController@postAdd');
    Route::get('area/edit/{id}', 'Common\AreaController@getEdit');
    Route::post('area/edit/{id}', 'Common\AreaController@postEdit');
    Route::get('area/del/{id}', 'Common\AreaController@getDel');
    // 会员卡
    Route::get('card/index', 'User\CardController@getIndex');
    Route::get('card/excel', 'User\CardController@getCardExcel');
    Route::get('card/add', 'User\CardController@getAdd');
    Route::post('card/add', 'User\CardController@postAdd');
    Route::get('card/edit/{id}', 'User\CardController@getEdit');
    Route::post('card/edit/{id}', 'User\CardController@postEdit');
    Route::post('card/del', 'User\CardController@postAlldel');
    // 退货管理
    Route::get('returngood/index', 'Good\RetrunGoodController@getIndex');
    Route::get('returngood/excel', 'Good\RetrunGoodController@getExcel');
    Route::get('returngood/status/{id}', 'Good\RetrunGoodController@getStatus');
    Route::post('returngood/status/{id}', 'Good\RetrunGoodController@postStatus');
    // 今日消费情况
    Route::get('index/consume', 'IndexController@getConsume');
    Route::get('index/excel_consume', 'IndexController@getExcelConsume');
    // 导出库房用表
    Route::get('index/excel_store', 'IndexController@getExcelStore');
    // 导出出货量
    Route::get('index/excel_goods', 'IndexController@getExcelGoods');
    // 导出待打印订单
    Route::get('index/excel_order', 'IndexController@getExcelOrders');
    // 自提点管理
    Route::get('extract/index', 'Good\ExtractController@getIndex');
    Route::get('extract/add', 'Good\ExtractController@getAdd');
    Route::post('extract/add', 'Good\ExtractController@postAdd');
    Route::get('extract/edit/{id}', 'Good\ExtractController@getEdit');
    Route::post('extract/edit/{id}', 'Good\ExtractController@postEdit');
    Route::get('extract/del/{id}', 'Good\ExtractController@getDel');
    Route::post('extract/sort', 'Good\ExtractController@postSort');
    Route::post('extract/alldel', 'Good\ExtractController@postAlldel');
    // 广告管理
    Route::get('ad/index', 'Common\AdController@getIndex');
    Route::get('ad/add', 'Common\AdController@getAdd');
    Route::post('ad/add', 'Common\AdController@postAdd');
    Route::get('ad/edit/{id}', 'Common\AdController@getEdit');
    Route::post('ad/edit/{id}', 'Common\AdController@postEdit');
    Route::get('ad/del/{id}', 'Common\AdController@getDel');
    Route::post('ad/sort', 'Common\AdController@postSort');
    Route::post('ad/alldel', 'Common\AdController@postAlldel');
    // 团购管理
    Route::get('tuan/index', 'Good\TuanController@getIndex');
    Route::get('tuan/add', 'Good\TuanController@getAdd');
    Route::post('tuan/add', 'Good\TuanController@postAdd');
    Route::get('tuan/edit/{id}', 'Good\TuanController@getEdit');
    Route::post('tuan/edit/{id}', 'Good\TuanController@postEdit');
    Route::get('tuan/del/{id}', 'Good\TuanController@getDel');
    Route::post('tuan/sort', 'Good\TuanController@postSort');
    Route::post('tuan/alldel', 'Good\TuanController@postAlldel');
    // 满赠管理
    Route::get('fullgift/index', 'Good\FullgiftController@getIndex');
    Route::get('fullgift/add', 'Good\FullgiftController@getAdd');
    Route::post('fullgift/add', 'Good\FullgiftController@postAdd');
    Route::get('fullgift/edit/{id}', 'Good\FullgiftController@getEdit');
    Route::post('fullgift/edit/{id}', 'Good\FullgiftController@postEdit');
    Route::get('fullgift/del/{id}', 'Good\FullgiftController@getDel');
    Route::post('fullgift/sort', 'Good\FullgiftController@postSort');
    Route::post('fullgift/alldel', 'Good\FullgiftController@postAlldel');
    // 优惠券管理
    Route::get('coupon/index', 'Good\CouponController@getIndex');
    Route::get('coupon/add', 'Good\CouponController@getAdd');
    Route::post('coupon/add', 'Good\CouponController@postAdd');
    Route::get('coupon/edit/{id}', 'Good\CouponController@getEdit');
    Route::post('coupon/edit/{id}', 'Good\CouponController@postEdit');
    Route::get('coupon/del/{id}', 'Good\CouponController@getDel');
    Route::post('coupon/sort', 'Good\CouponController@postSort');
    Route::post('coupon/alldel', 'Good\CouponController@postAlldel');
    // 活动管理
    Route::get('promotion/index', 'Good\PromotionController@getIndex');
    Route::get('promotion/add', 'Good\PromotionController@getAdd');
    Route::post('promotion/add', 'Good\PromotionController@postAdd');
    Route::get('promotion/edit/{id}', 'Good\PromotionController@getEdit');
    Route::post('promotion/edit/{id}', 'Good\PromotionController@postEdit');
    Route::get('promotion/del/{id}', 'Good\PromotionController@getDel');
    Route::get('promotion/goodlist/{id}', 'Good\PromotionController@getGoodlist');
    Route::post('promotion/sort', 'Good\PromotionController@postSort');
    Route::post('promotion/alldel', 'Good\PromotionController@postAlldel');
    // 订单管理
    Route::get('order/index', 'Good\OrderController@index');
    Route::get('order/del/{id}', 'Good\OrderController@getDel');
    Route::get('order/ship/{id}', 'Good\OrderController@getShip');
    Route::post('order/ship/{id}', 'Good\OrderController@postShip');
    Route::get('order/print/{id}', 'Good\OrderController@getPrint');
    // Route::get('order/tui/{id}', 'Good\OrderController@getTui');
    Route::get('order/ziti/{id}', 'Good\OrderController@getZiti');
    // 批量自提、发货、关闭
    Route::post('order/allship', 'Good\OrderController@postAllShip');
    Route::post('order/allziti', 'Good\OrderController@postAllZiti');
    Route::post('order/allclose', 'Good\OrderController@postAllDel');
    // 支付配置
    Route::get('pay/index', 'Common\PayController@getIndex');
    Route::get('pay/edit/{id}', 'Common\PayController@getEdit');
    Route::post('pay/edit/{id}', 'Common\PayController@postEdit');
    // 商品分类
    Route::get('goodcate/index', 'Good\GoodCateController@getIndex');
    Route::get('goodcate/cache', 'Good\GoodCateController@getCache');
    Route::get('goodcate/add/{id?}', 'Good\GoodCateController@getAdd');
    Route::post('goodcate/add/{id?}', 'Good\GoodCateController@postAdd');
    Route::get('goodcate/edit/{id?}', 'Good\GoodCateController@getEdit');
    Route::post('goodcate/edit/{id?}', 'Good\GoodCateController@postEdit');
    Route::get('goodcate/del/{id?}', 'Good\GoodCateController@getDel');
    Route::get('goodcate/attr/{id?}', 'Good\GoodCateController@getAttr');
    Route::post('goodcate/attr/{id?}', 'Good\GoodCateController@postAttr');
    Route::post('goodcate/sort', 'Good\GoodCateController@postSort');
    // 商品规格
    Route::get('goodspec/index/{pid?}', 'Good\GoodSpecController@getIndex');
    Route::get('goodspec/add', 'Good\GoodSpecController@getAdd');
    Route::post('goodspec/add', 'Good\GoodSpecController@postAdd');
    Route::get('goodspec/edit/{id}', 'Good\GoodSpecController@getEdit');
    Route::post('goodspec/edit/{id}', 'Good\GoodSpecController@postEdit');
    Route::get('goodspec/del/{id?}', 'Good\GoodSpecController@getDel');
    // 商品
    Route::get('good/index', 'Good\GoodController@getIndex');
    Route::get('good/nostore', 'Good\GoodController@getNostore');
    Route::get('good/add/{id?}', 'Good\GoodController@getAdd');
    Route::post('good/add/{id?}', 'Good\GoodController@postAdd');
    Route::get('good/edit/{id?}', 'Good\GoodController@getEdit');
    Route::post('good/edit/{id?}', 'Good\GoodController@postEdit');
    Route::get('good/del/{id}/{status}', 'Good\GoodController@getDel');
    Route::post('good/sort', 'Good\GoodController@postSort');
    Route::post('good/alldel', 'Good\GoodController@postAlldel');
    // 商品批量上下架
    Route::post('good/allstatus', 'Good\GoodController@postAllStatus');
    Route::post('good/allcate', 'Good\GoodController@postAllCate');
    // 取商品分类及规格
    Route::get('good/goodspec', 'Good\GoodController@getGoodSpec');
    Route::get('good/goodspecstr', 'Good\GoodController@getGoodSpecStr');
    Route::post('good/goodspecinput', 'Good\GoodController@postGoodSpecInput');    
    // Index
    Route::get('index/index', 'IndexController@getIndex');
    Route::get('index/main', 'IndexController@getMain');
    Route::get('index/left/{id}', 'IndexController@getLeft');
    Route::get('index/cache', 'IndexController@getCache');
    // 系统配置
    Route::get('config/index', 'ConfigController@index');
    Route::post('config/index', 'ConfigController@postIndex');
    // admin
    Route::get('admin/index', 'AdminController@getIndex');
    Route::get('admin/add', 'AdminController@getAdd');
    Route::post('admin/add', 'AdminController@postAdd');
    Route::post('admin/edit/{id?}', 'AdminController@postEdit');
    Route::get('admin/edit/{id?}', 'AdminController@getEdit');
    Route::get('admin/pwd/{id?}', 'AdminController@getPwd');
    Route::post('admin/pwd/{id?}', 'AdminController@postPwd');
    Route::get('admin/del/{id?}', 'AdminController@getDel');
    Route::get('admin/myedit', 'AdminController@getMyedit');
    Route::post('admin/myedit', 'AdminController@postMyedit');
    Route::get('admin/mypwd', 'AdminController@getMypwd');
    Route::post('admin/mypwd', 'AdminController@postMypwd');
    // role
    Route::get('role/index', 'RoleController@getIndex');
    Route::get('role/add', 'RoleController@getAdd');
    Route::post('role/add', 'RoleController@postAdd');
    Route::get('role/edit/{id?}', 'RoleController@getEdit');
    Route::post('role/edit/{id?}', 'RoleController@postEdit');
    Route::get('role/del/{id?}', 'RoleController@getDel');
    Route::get('role/priv/{id?}', 'RoleController@getPriv');
    Route::post('role/priv/{id?}', 'RoleController@postPriv');
    // 部门
    Route::get('section/index', 'SectionController@getIndex');
    Route::get('section/add', 'SectionController@getAdd');
    Route::post('section/add', 'SectionController@postAdd');
    Route::get('section/edit/{id}', 'SectionController@getEdit');
    Route::post('section/edit/{id}', 'SectionController@postEdit');
    Route::get('section/del/{id}', 'SectionController@getDel');
    // menu
    Route::get('menu/index', 'MenuController@getIndex');
    Route::get('menu/add/{id?}', 'MenuController@getAdd');
    Route::post('menu/add/{id?}', 'MenuController@postAdd');
    Route::get('menu/edit/{id}', 'MenuController@getEdit');
    Route::post('menu/edit/{id}', 'MenuController@postEdit');
    Route::get('menu/del/{id}', 'MenuController@getDel');
    // log
    Route::get('log/index', 'LogController@getIndex');
    Route::get('log/del', 'LogController@getDel');
    // cate
    Route::get('cate/index', 'Common\CateController@getIndex');
    Route::get('cate/cache', 'Common\CateController@getCache');
    Route::get('cate/add/{id?}', 'Common\CateController@getAdd');
    Route::post('cate/add/{id?}', 'Common\CateController@postAdd');
    Route::get('cate/edit/{id?}', 'Common\CateController@getEdit');
    Route::post('cate/edit/{id?}', 'Common\CateController@postEdit');
    Route::get('cate/del/{id?}', 'Common\CateController@getDel');
    // attr
    Route::get('attr/index', 'Common\AttrController@getIndex');
    Route::get('attr/delfile/{id?}', 'Common\AttrController@getDelfile');
    Route::post('attr/uploadimg', 'Common\AttrController@postUploadimg');
    // art
    Route::get('art/index', 'Common\ArtController@getIndex');
    Route::get('art/add/{id?}', 'Common\ArtController@getAdd');
    Route::post('art/add/{id?}', 'Common\ArtController@postAdd');
    Route::get('art/edit/{id}', 'Common\ArtController@getEdit');
    Route::post('art/edit/{id}', 'Common\ArtController@postEdit');
    Route::get('art/del/{id}', 'Common\ArtController@getDel');
    Route::get('art/show/{id}', 'Common\ArtController@getShow');
    Route::post('art/alldel', 'Common\ArtController@postAlldel');
    Route::post('art/listorder', 'Common\ArtController@postListorder');
    // database
    Route::get('database/export', 'DatabaseController@getExport');
    Route::post('database/export', 'DatabaseController@postExport');
    Route::get('database/import/{pre?}', 'DatabaseController@getImport');
    Route::post('database/delfile', 'DatabaseController@postDelfile');
    // type
    Route::get('type/index/{pid?}', 'Common\TypeController@getIndex');
    Route::get('type/add/{id?}', 'Common\TypeController@getAdd');
    Route::post('type/add/{id?}', 'Common\TypeController@postAdd');
    Route::get('type/edit/{id?}', 'Common\TypeController@getEdit');
    Route::post('type/edit/{id?}', 'Common\TypeController@postEdit');
    Route::get('type/del/{id?}', 'Common\TypeController@getDel');
    // 会员组
    Route::get('group/index', 'User\GroupController@getIndex');
    Route::get('group/add', 'User\GroupController@getAdd');
    Route::post('group/add', 'User\GroupController@postAdd');
    Route::get('group/edit/{id}', 'User\GroupController@getEdit');
    Route::post('group/edit/{id}', 'User\GroupController@postEdit');
    Route::get('group/del/{id}', 'User\GroupController@getDel');
    // 会员
    Route::get('user/index', 'User\UserController@getIndex');
    Route::get('user/edit/{id}', 'User\UserController@getEdit');
    Route::post('user/edit/{id}', 'User\UserController@postEdit');
    Route::get('user/status/{id}/{status}', 'User\UserController@getStatus');
    Route::get('user/chong/{id}', 'User\UserController@getChong');
    Route::post('user/chong/{id}', 'User\UserController@postChong');
    Route::get('user/consumed/{id}', 'User\UserController@getConsumed');
    Route::post('user/consumed/{id}', 'User\UserController@postConsumed');
    Route::get('user/consume/{id}', 'User\UserController@getConsume');
    Route::get('user/address/{id}', 'User\UserController@getAddress');
    Route::get('user/ranking', 'User\UserController@getConsumeRanking');
    Route::get('user/excel', 'User\UserController@getExcel');
});
